//
//  ZPostCommentView.m
//  DoctorFAQs
//
//  Created by zjq on 17/2/23.
//  Copyright © 2017年 zjq. All rights reserved.
//

#import "ZPostCommentView.h" 
@interface ZPostCommentView () {
    UIImageView * _imageView;
}
@end

@implementation ZPostCommentView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self initlizeInterface];
    }
    return self;
}

- (void)initlizeInterface {
    self.backgroundColor = [UIColor whiteColor];
    _postBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    _postBtn.layer.cornerRadius = 2.5;
    _postBtn.layer.masksToBounds = YES;
    [_postBtn setTitle:@"发表" forState:UIControlStateNormal];
    [_postBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [_postBtn setBackgroundColor:MYGREENColor];
    
    _commentField = [[UITextField alloc] init];
    _commentField.backgroundColor = [UIColor whiteColor];
    _imageView = [[UIImageView alloc] init];
    _imageView.image = [UIImage imageNamed:@"comment_txt"];
    [self addSubview:_commentField];
    [self addSubview:_postBtn];
    [self addSubview:_imageView];
    [_commentField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15*xsIZE);
        make.right.equalTo(_postBtn.mas_left).offset(-10*xsIZE);
        make.centerY.equalTo(self);
        make.height.offset(35*ysIZE);
    }];
    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(_commentField);
        make.width.equalTo(_commentField).multipliedBy(1.02);
        make.height.offset(6*ysIZE);
        make.top.equalTo(_commentField.mas_bottom).offset(-8*ysIZE);
    }];
    [_postBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.offset(45*xsIZE);
        make.height.offset(25*ysIZE);
        make.right.equalTo(self).offset(-10*xsIZE);
        make.centerY.equalTo(self);
    }];
}
@end
